package com.example.streamconsumer.stream;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Component;

/**
 * @Author: lihui
 * @Date: 2022-03-23 09:19
 * @Description:
 */
@Component
@EnableBinding(InputInterface.class)
public class MsgConsumer {

    @StreamListener(InputInterface.MSG_INPUT)
    public void receive(String message){
        System.out.println("message = "+ message);
    }

    @StreamListener(InputInterface.DEFAULT)
    public void receiveDefaultMsg(String message){
        System.out.println("default message = "+ message);
    }

}
